﻿@{
    
    var errorLabel = " ";
    var firstname = this.Request.Form["firstname"];
    var email = this.Request.Form["Details"];
    if (firstname == String.Empty)
    {
        errorLabel = "Please enter a valid name";
        //Response.Redirect(Request.RawUrl);
    }

   else if (email == String.Empty)
    {
        errorLabel = "Please enter a few details abut the incident";
        
    }
        
    else {
        
            if (this.Request.Form["Button1"] == "Submit")
            {
                MyModel.incident.SendIncident(this.Request.Form["firstname"], this.Request.Form["mydropdownroad"], this.Request.Form["mydropdowncity"],
                    this.Request.Form["mydropdownaccident"], this.Request.Form["Details"]);
            }
    }
    
        
    Page.Title = "Laos Traveller - Report A Traffic Incident";
    Layout = "LaosLayout.cshtml"; 
}
  
<h1>
    Laos Traveller - Report A Traffic Incident</h1>

<div class="innerpage">
    <h1>Incident Information</h1>
 <p>
 <label id="lblError">@errorLabel</label>
</p>
<p>
    &nbsp;</p>
    
    <form name="form1" method="post">
    <p>
<span class="ddlabelscontact">Email:</span>
<input type="text" name="firstname" class="ddtextboxes"/>
</p>
<p>
    &nbsp;</p>
    <p>
<span class="ddlabelscontact">Road:</span>
<select name="mydropdownroad" class="ddtextboxes">
    <option value="r1">Route 1</option>
    <option value="r2">Route 2</option>
    <option value="r3">Route 3</option>
</select>
</p>
<p>
    &nbsp;</p>
    <p>
<span class="ddlabelscontact">Town:</span>
<select name="mydropdowncity" class="ddtextboxes">
                <option value="">Select city:</option>
                <option value="001">Luang Prabang</option>
                <option value="002">Pakse</option>
                <option value="Vientiene">Vientiene</option>
                <option value="VangVieng">Vang Vieng</option>
                <option value="Bokeo">Bokeo Province</option>
                <option value="Bolaven Plateau">Bolaven Plateau</option>
                <option value="Champasak">Champasake</option>
                <option value="Don Det & Don Khon">Don Det & Don Khon</option>
                <option value="Don Khong">Don Khong</option>
                <option value="Hua Phan Province">Hua Phan Province</option>
                <option value="Huay Xai">Huay Xai</option>
                <option value="Bokeo">Luang Nam Tha</option>
                <option value="Bokeo">Luang Prabang</option>
                <option value="Bokeo">Luang Prabang Province</option>
                <option value="Bokeo">Muang Ngoi Neua</option>
                <option value="Bokeo">Muang Sing</option>
                <option value="Bokeo">Nong Khiaw</option>
                <option value="Bokeo">Pakse</option>
                <option value="Bokeo">Phonsavan</option>
                <option value="Bokeo">Plain of Jars</option>
                <option value="Bokeo">Sam Neua</option>
                <option value="Bokeo">Savannakhet</option>
                <option value="Bokeo">Savannakhet Provinces</option>
                <option value="Bokeo">Si Phan Don</option>
                <option value="Bokeo">Southern Laos</option>
                <option value="Bokeo">Tadlo</option>
                <option value="Bokeo">Udomxai</option>
                <option value="Bokeo">Udomxai Province</option>
                <option value="Bokeo">Vang Vieng</option>
                <option value="Bokeo">Vieng Xai</option>
                <option value="Bokeo">Vientiane</option>
                <option value="Bokeo">Vientiane Province</option>
                <option value="Bokeo">Xieng Khuang Province</option>
</select>
</p>
<p>&nbsp;</p>
<p>
<span class="ddlabelscontact">Type of Incident:</span>
<select name="mydropdownaccident" class="ddtextboxes">
    <option value="O1">Accident </option>
    <option value="O2">Road Works </option>
    <option value="O3">Road Closure </option>
    <option value="O4">Flooded River </option>
    <option value="O5">Collapsed Bridge </option>
    <option value="O6">other </option>
</select>
</p>

<p>&nbsp;</p>
<p>
    <span class="ddlabelscontact"></span><textarea rows="2" cols="20" id="TextArea1" placeholder="Please give a rough description of the incident here" name="Details" style="height: 249px; width: 500px; display:inline"></textarea>
    
    </p>
    <p>&nbsp;</p>
    <p>
    <input type="checkbox" value="Y"/>
    I confirm that you can contact me about this incident using the email provided
    
    </p>
    <input type="submit" value="Submit" id="Button1" name="Button1"/>
    </form>
</div>
